home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 140
/
(Vol 140) Sep 19 2011.iso
/
Games
/
sea_of_fire.swf
/
scripts
/
frame_88
/
DoAction_7.as
< prev
next >
Wrap
Text File
|
2011-09-19
|
4KB
|
163 lines
function create_stru(stru_name, ai, b_tile)
{
switch(b_tile)
{
case 3:
s_depth = 0;
break;
case 1:
s_depth = 500;
break;
case 5:
s_depth = 501;
break;
case 4:
s_depth = 1000;
break;
case 7:
s_depth = 1001;
break;
case 2:
s_depth = 1500;
break;
case 6:
s_depth = 1501;
break;
case 11:
s_depth = 1;
break;
case 9:
s_depth = 502;
break;
case 13:
s_depth = 503;
break;
case 10:
s_depth = 1002;
break;
case 14:
s_depth = 1003;
break;
case 8:
s_depth = 1502;
break;
case 12:
s_depth = 1503;
}
duplicateMovieClip(_root[stru_name],"stru" + b_tile,16384 + s_depth);
_root["stru" + b_tile]._x = _root["tile" + b_tile]._x;
_root["stru" + b_tile]._y = _root["tile" + b_tile]._y;
_root["stru" + b_tile].name = "stru" + b_tile;
_root["stru" + b_tile].ai = ai;
_root["stru" + b_tile].active = 1;
_root["stru" + b_tile].base_tile = b_tile;
_root["tile" + b_tile]._visible = 0;
if(tile_sel == b_tile)
{
select_tile(tile_sel);
}
}
function create_con_site_0(stru_name, ai, b_tile, value)
{
duplicateMovieClip(_root.con_site_0,"cs" + b_tile,16384 + stru_depth);
_root["cs" + b_tile]._x = _root["tile" + b_tile]._x;
_root["cs" + b_tile]._y = _root["tile" + b_tile]._y;
_root["cs" + b_tile].ai = ai;
_root["cs" + b_tile].current = stru_name;
_root["cs" + b_tile].delay = value / 5;
_root["cs" + b_tile].delay_max = value / 5;
_root["cs" + b_tile].base_tile = b_tile;
_root["cs" + b_tile].active = 1;
stru_depth++;
_root["tile" + b_tile]._visible = 0;
if(ai == 0)
{
select_tile(b_tile);
}
}
function create_con_site_1(stru_name, ai, b_tile, value)
{
duplicateMovieClip(_root.con_site_1,"cs" + b_tile,16384 + stru_depth);
_root["cs" + b_tile]._x = _root["tile" + b_tile]._x;
_root["cs" + b_tile]._y = _root["tile" + b_tile]._y;
_root["cs" + b_tile].ai = ai;
_root["cs" + b_tile].current = stru_name;
_root["cs" + b_tile].delay = value / 5;
_root["cs" + b_tile].delay_max = value / 5;
_root["cs" + b_tile].base_tile = b_tile;
_root["cs" + b_tile].active = 1;
stru_depth++;
_root["tile" + b_tile]._visible = 0;
select_tile(b_tile);
}
function damage_base(val, b)
{
found = 0;
if(b == 0)
{
ai_surv++;
i = 1;
while(i <= 7)
{
if(_root["stru" + i].hp > 0)
{
_root["stru" + i].damage(val,1);
found = 1;
break;
}
i++;
}
}
else
{
hu_surv++;
i = 8;
while(i <= 14)
{
if(_root["stru" + i].hp > 0)
{
_root["stru" + i].damage(val,1);
found = 1;
break;
}
i++;
}
}
if(found == 0)
{
if(b == 0)
{
end_level(0);
}
else
{
end_level(1);
}
}
}
function end_level(v)
{
_root.AI.active = 0;
kill_all();
hide_tiles();
_root["interface"]._visible = 0;
_root.sel_instance._x = -200;
hide_all();
show_stats();
if(v == 1)
{
_root.mentat_screen["reg_" + cur_reg].ai = 0;
_root.stats_screen.proceed._visible = 1;
_root.stats_screen.result_txt.text = "VICTORY!";
}
else
{
_root.stats_screen.proceed._visible = 0;
_root.stats_screen.result_txt.text = "DEFEAT!";
}
if(skirmish == 1)
{
_root.stats_screen.proceed._visible = 0;
}
}